/*
 Navicat Premium Data Transfer

 Source Server         : localhost_3306
 Source Server Type    : MySQL
 Source Server Version : 80032
 Source Host           : localhost:3306
 Source Schema         : xdu_property

 Target Server Type    : MySQL
 Target Server Version : 80032
 File Encoding         : 65001

 Date: 11/05/2023 13:17:01
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for charge
-- ----------------------------
DROP TABLE IF EXISTS `charge`;
CREATE TABLE `charge` (
  `id` bigint NOT NULL COMMENT '收费单号(主键)',
  `room_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '房号',
  `start_date` datetime DEFAULT NULL COMMENT '开始月份',
  `end_date` datetime DEFAULT NULL COMMENT '截止月份',
  `owner_id` bigint NOT NULL COMMENT '业主编号',
  `property_money` decimal(10,2) DEFAULT NULL COMMENT '物业费金额',
  `elevator_money` decimal(10,2) DEFAULT NULL COMMENT '电梯费金额',
  `water_money` decimal(10,2) DEFAULT NULL COMMENT '水费',
  `electric_money` decimal(10,2) DEFAULT NULL COMMENT '电费',
  `total_money` decimal(10,2) NOT NULL COMMENT '总金额',
  `employee_id` bigint NOT NULL COMMENT '执行收费操作的员工号',
  `charge_date` datetime NOT NULL COMMENT '收费日期',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of charge
-- ----------------------------
BEGIN;
INSERT INTO `charge` VALUES (1605621071585738753, '2期3单元25号楼5层1户', '2022-12-01 00:00:00', '2023-02-01 00:00:00', 2134123, 300.88, 50.00, 30.80, 26.40, 408.08, 10001, '2022-12-22 01:47:49');
INSERT INTO `charge` VALUES (1605814208115576833, '2期3单元25号楼5层1户', '2022-02-01 00:00:00', '2022-12-01 00:00:00', 2134123, 1504.40, 250.00, 45.50, 36.00, 1835.90, 1604443366014111745, '2022-12-22 14:35:16');
INSERT INTO `charge` VALUES (1605814297500389378, '2期3单元25号楼7层3户', '2022-12-01 00:00:00', '2023-02-01 00:00:00', 1605490682867261442, 201.00, 70.00, 16.10, 18.40, 305.50, 1604443366014111745, '2022-12-22 14:35:38');
INSERT INTO `charge` VALUES (1605815375587491841, '2期3单元25号楼5层1户', '2022-12-01 00:00:00', '2023-02-01 00:00:00', 2134123, 300.88, 50.00, 56.00, 36.00, 442.88, 10001, '2022-12-22 14:39:55');
INSERT INTO `charge` VALUES (1605815939473899521, '2期3单元25号楼7层3户', '2023-02-01 00:00:00', '2023-07-01 00:00:00', 1605490682867261442, 502.50, 175.00, 70.00, 32.00, 779.50, 10001, '2022-12-22 14:42:09');
INSERT INTO `charge` VALUES (1605816259281219586, '2期3单元25号楼5层1户', '2023-02-01 00:00:00', '2023-03-01 00:00:00', 2134123, 150.44, 25.00, 70.00, 80.00, 325.44, 1604443366014111745, '2022-12-22 14:43:25');
INSERT INTO `charge` VALUES (1605816495705780226, '2期3单元25号楼5层1户', '2023-03-01 00:00:00', '2023-04-01 00:00:00', 2134123, 150.44, 25.00, 70.00, 80.00, 325.44, 10001, '2022-12-22 14:44:22');
INSERT INTO `charge` VALUES (1605816851248517121, '2期3单元25号楼5层1户', '2023-04-01 00:00:00', '2023-05-01 00:00:00', 2134123, 150.44, 25.00, 49.00, 80.00, 304.44, 10001, '2022-12-22 14:45:47');
INSERT INTO `charge` VALUES (1605817418935001090, '2期3单元25号楼5层1户', '2023-05-01 00:00:00', '2023-06-01 00:00:00', 2134123, 150.44, 25.00, 70.00, 80.00, 325.44, 10001, '2022-12-22 14:48:02');
INSERT INTO `charge` VALUES (1605817648141127681, '2期3单元25号楼7层3户', '2023-07-01 00:00:00', '2023-08-01 00:00:00', 1605490682867261442, 100.50, 35.00, 70.00, 80.00, 285.50, 10001, '2022-12-22 14:48:57');
INSERT INTO `charge` VALUES (1655490722192711682, '2期3单元25号楼5层2户', '2023-05-01 00:00:00', '2023-06-01 00:00:00', 1605044654120726529, 200.00, 25.00, 69.30, 70.40, 364.70, 10001, '2023-05-08 16:32:00');
COMMIT;

-- ----------------------------
-- Table structure for department
-- ----------------------------
DROP TABLE IF EXISTS `department`;
CREATE TABLE `department` (
  `id` bigint NOT NULL COMMENT '部门号(主键)',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '部门名称',
  `leader_id` bigint NOT NULL COMMENT '部门负责人',
  `phone` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '部门电话',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of department
-- ----------------------------
BEGIN;
INSERT INTO `department` VALUES (1605170776124747777, '卢志文部门', 1604443366014111745, '13709215465');
INSERT INTO `department` VALUES (1605238475806752769, '美团部门', 1605025745527177218, '13477775555');
INSERT INTO `department` VALUES (1656521723484323841, '饿了么部门', 10001, '13722223333');
COMMIT;

-- ----------------------------
-- Table structure for employee
-- ----------------------------
DROP TABLE IF EXISTS `employee`;
CREATE TABLE `employee` (
  `id` bigint NOT NULL COMMENT '员工号(主键)',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '姓名',
  `birth_date` datetime NOT NULL COMMENT '出生年月',
  `sex` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '性别',
  `address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '住址',
  `phone` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '联系电话',
  `department_id` bigint NOT NULL COMMENT '所在部门号',
  `status` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '职务',
  `password` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '密码',
  `username` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `employee_username_uindex` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of employee
-- ----------------------------
BEGIN;
INSERT INTO `employee` VALUES (10001, '张粤', '2022-12-17 15:23:54', '1', '河南省开封市', '13709215464', 1605238475806752769, '1', 'e10adc3949ba59abbe56e057f20f883e', '1084511522');
INSERT INTO `employee` VALUES (1604443366014111745, '卢志文', '2022-11-17 00:00:00', '1', '蚌埠住了', '13399999999', 1605170776124747777, '0', 'e10adc3949ba59abbe56e057f20f883e', '3176030019');
INSERT INTO `employee` VALUES (1605025745527177218, '李俊杰', '2022-12-20 00:00:00', '0', '山西', '13722222222', 1656521723484323841, '0', 'e10adc3949ba59abbe56e057f20f883e', '111222');
COMMIT;

-- ----------------------------
-- Table structure for owner
-- ----------------------------
DROP TABLE IF EXISTS `owner`;
CREATE TABLE `owner` (
  `id` bigint NOT NULL COMMENT '主键',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '姓名',
  `company_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '工作单位',
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '联系电话',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of owner
-- ----------------------------
BEGIN;
INSERT INTO `owner` VALUES (2134123, '张粤', '卢志文公司', '13709215464');
INSERT INTO `owner` VALUES (1605044654120726529, '卢志文', '卢志文俊杰公司', '13922228888');
INSERT INTO `owner` VALUES (1605490682867261442, '李俊杰', '山西煤矿', '13788888889');
COMMIT;

-- ----------------------------
-- Table structure for room
-- ----------------------------
DROP TABLE IF EXISTS `room`;
CREATE TABLE `room` (
  `id` bigint NOT NULL,
  `room_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `area` decimal(10,2) DEFAULT NULL,
  `valid_date` datetime DEFAULT NULL,
  `owner_id` bigint DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `room_room_number_uindex` (`room_number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='房屋表';

-- ----------------------------
-- Records of room
-- ----------------------------
BEGIN;
INSERT INTO `room` VALUES (1605483547370536961, '2期3单元25号楼5层1户', 150.44, '2023-06-01 00:00:00', 2134123);
INSERT INTO `room` VALUES (1605813209145597953, '2期3单元25号楼7层3户', 100.50, '2023-08-01 00:00:00', 1605490682867261442);
INSERT INTO `room` VALUES (1655490543544721409, '2期3单元25号楼5层2户', 200.00, '2023-06-01 00:00:00', 1605044654120726529);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
